﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Import Namespace="Uber.WebUI.Controllers" %>
<asp:Content ID="loginTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Log In
</asp:Content>
<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        function oa(o) {
            var u = '';
            if (o == 'google') u = 'https://www.google.com/accounts/o8/id';
            if (o == 'yahoo') u = 'http://yahoo.com/';
            if (o == 'myopenid') u = 'http://myopenid.com/';
            if (o == 'se') u = 'https://openid.stackexchange.com';
            $('#oi').val(u);
            $('#ois').click();
        }
    </script>
    <div class="subheader">
        <h1 class="ib">Log In</h1>
             <%if(ViewData["reason"] != null)
      {
          %>
          <div class="reason ib">
          You have to be logged in to: buy products from our site, download your purchases or ask questions
          </div>
          <%
      }%>
    </div>  

    <div class="ib vt">
        <p>
            Do you already have an account on one of these sites? Click the logo to <b>log in</b>
            with it here:
        </p>
        <div id="obs" class="ib">
            <a id='gid' href="javascript:oa('google')" title="log in with google"></a>
            <a id='yid' href="javascript:oa('yahoo')" title="log in with yahoo"></a>
            <a id="myid" href="javascript:oa('myopenid')" title="log in with myopenid"></a>
            <a id="seid" href="javascript:oa('se')" title="log in with stackexchange"></a>

        </div>
        <p>
            Or, you can manually enter your OpenID</p>
        <form action="Authenticate?ReturnUrl=<%=HttpUtility.UrlEncode(Request.QueryString["returnUrl"]) %>"
        method="post">
        <input id="oi" name="oi" size="40" class="openid-identifier" />
        <input type="submit" value="Log in" id="ois" class="grbtn" />
        </form>
        <%=Html.ValidationMessage("oid") %>
    </div>
    
    <div class="fr">
        <div class="bluebox">
            <p>
                Log in with your Awesome account</p>
            <form method="post" action='<%=Url.Action("LogIn") %>'>
            <input type="hidden" name="returnUrl" value="<%=Url.Encode((Request.QueryString["returnUrl"])) %>"/>
            <div class="efield">
                <div class="elabel">
                    <label for="Email">
                        Email:</label>
                </div>
                <div class="einput">
                   <input type="text" id="Email" name="Email" size="25"/>
                    <%= Html.ValidationMessage("Email")%>
                </div>
            </div>
            <div class="efield">
                <div class="elabel">
                    <label for="Password">
                        Password:</label>
                </div>
                <div class="einput">
                    <input type="password" id="Password" name="Password" size="25"/>
                    <%= Html.ValidationMessage("Password") %>
                </div>
            </div>
            <div class="efield">
                <div class="elabel">
                    <label class="inline" for="rememberMe">
                        Remember me</label>
                </div>
                <div class="einput">
                    <%= Html.CheckBox("rememberMe") %>
                </div>
            </div>
            <div class="esubmit">
                <input type="submit" value="Log in" />
            </div>
            <div class="efield">
                <%= Html.ActionLink<AccountController>(o => o.RequestPasswordReset(), "forgotten password ?") %>
            </div>
            <%=Html.ValidationMessage("alogin") %>
            </form>
        </div>
        <br />
        <div class="bluebox">
            Don't have an Awesome account ? <a href='<%=Url.Action("index","register") %>'>Register
                now</a>
        </div>
    </div>
    
</asp:Content>
